﻿namespace Mercury.ParticleEngine
{
    using System;

    /// <summary>
    /// Defines information about the release of an individual particle.
    /// </summary>
    public struct ReleaseContext
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ReleaseContext"/> struct.
        /// </summary>
        /// <param name="triggerContext">A reference to the trigger context which caused a particle release.</param>
        /// <param name="worldPosition">The world position at which the particle is being released.</param>
        /// <param name="direction">The initial direction of the particle.</param>
        internal ReleaseContext(ref TriggerContext triggerContext, Coordinate worldPosition, Axis direction)
        {
            TotalSeconds     = triggerContext.TotalSeconds;
            WorldPosition    = worldPosition;
            Direction        = direction;
        }

        /// <summary>
        /// Gets the total elapsed seconds in the simulation.
        /// </summary>
        public readonly Single TotalSeconds;

        /// <summary>
        /// Gets the world position at which the particle is being released.
        /// </summary>
        public readonly Coordinate WorldPosition;

        /// <summary>
        /// Gets the initial velocity applied to the particle.
        /// </summary>
        public readonly Axis Direction;
    }
}